home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / redakcyjne / programy / eM CLient 2.0.5952.0 Beta / setup.msi / eMClient.cab / ManualChmFile / skinsupport / madcapglossary.js < prev    next >
Text File  |  2009-09-08  |  3KB  |  108 lines

  1. // {{MadCap}} //////////////////////////////////////////////////////////////////
  2. // Copyright: MadCap Software, Inc - www.madcapsoftware.com ////////////////////
  3. ////////////////////////////////////////////////////////////////////////////////
  4. // <version>3.0.0.0</version>
  5. ////////////////////////////////////////////////////////////////////////////////
  6.  
  7. //
  8.  
  9. if ( FMCIsDotNetHelp() || FMCIsHtmlHelp() )
  10. {
  11.     window.name = "glossary";
  12. }
  13.  
  14. //
  15.  
  16. var gInit   = false;
  17.  
  18. if ( !FMCIsDotNetHelp() && !FMCIsHtmlHelp() )
  19. {
  20.     gOnloadFuncs.push( Init );
  21. }
  22.  
  23. function Init()
  24. {
  25.     if ( gInit )
  26.     {
  27.         return;
  28.     }
  29.     
  30.     //
  31.  
  32.     var masterHS    = parent.parent.GetMasterHelpSystem();
  33.     
  34.     masterHS.LoadGlossary( LoadGlossaryOnComplete, null );
  35.     
  36.     //
  37.     
  38.     gInit = true;
  39. }
  40.  
  41. function LoadGlossaryOnComplete( xmlDoc, args )
  42. {
  43.     if ( xmlDoc == null )
  44.     {
  45.         return;
  46.     }
  47.     
  48.     var glossaryDoc    = FMCGetRootFrame().frames["navigation"].frames["glossary"].document;
  49.     var body1        = glossaryDoc.getElementsByTagName( "body" )[0];
  50.     
  51.     if ( window.ActiveXObject )
  52.     {
  53.         var body2   = xmlDoc.getElementsByTagName( "body" )[0];
  54.         
  55.         if ( body2 == null )
  56.         {
  57.             return;
  58.         }
  59.         
  60.         body1.innerHTML = body2.xml;
  61.     }
  62.     else if ( window.XMLSerializer )
  63.     {
  64.         var document1   = glossaryDoc;
  65.         var serializer  = new XMLSerializer();
  66.         var xmlAsString = serializer.serializeToString( xmlDoc );
  67.         
  68.         body1.innerHTML = xmlAsString;
  69.     }
  70.  
  71.     // IE 6.0+ bug. When loading the glossary, we replace the document's body with XML. For some reason, this causes
  72.     // the 11th line of the document to not render in IE. This works around that issue.
  73.     
  74.     var masterHS    = parent.parent.GetMasterHelpSystem();
  75.     
  76.     if ( document.body.currentStyle && masterHS.IsMerged() )
  77.     {
  78.         setTimeout( "SetGlossaryIFrameWidth();", 50 );
  79.     }
  80. }
  81.  
  82. function SetGlossaryIFrameWidth()
  83. {
  84.     parent.document.getElementById( "glossary" ).style.width = "100%";
  85. }
  86.  
  87. function DropDownTerm( anchorName )
  88. {
  89.     var anchors = document.getElementsByTagName( "a" );
  90.     
  91.     for ( var i = 0; i < anchors.length; i++ )
  92.     {
  93.         var anchor  = anchors[i];
  94.         
  95.         if ( anchor.name == anchorName )
  96.         {
  97.             if ( FMCGetChildNodesByTagName( anchor.parentNode.parentNode, "DIV" )[1].style.display == "none" )
  98.             {
  99.                 FMCDropDown( anchor.parentNode.getElementsByTagName( "a" )[0] );
  100.             }
  101.             
  102.             break;
  103.         }
  104.     }
  105.     
  106.     FMCScrollToVisible( window, anchor.parentNode.parentNode );
  107. }
  108.